import 'package:boss/provider/material_provider.dart';
import 'package:boss/ui/widget/search_bar.dart';
import 'package:flutter/material.dart';
import 'package:provider/provider.dart';

class MaterialPickerSearchBar extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return Container(
      child: SearchBar(
        hintText: '搜索加料名称',
        onChanged: (value) {
          var materialProvider = Provider.of<MaterialProvider>(
            context,
            listen: false,
          );
          materialProvider.setSearchWord(value);
        },
      ),
    );
  }
}
